#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <time.h>
#include <string.h>
#include <linux/msdos_fs.h>

// Defined Error Code in here
#ifndef ERRCODE
#define ERRCODE int32_t
#endif

#define DSC_ERR					0x80800000							
#define ERR_DSC_SUCCESS				0
#define ERR_DSC_OPEN_INDEX_FILE			(DSC_ERR | 0x1)
#define ERR_DSC_MALLOC				(DSC_ERR | 0x2)
#define ERR_DSC_OPEN_CAP_FILE			(DSC_ERR | 0x3)


#define AVUtil_Malloc malloc
#define AVUtil_Free free


#define DSC_INDEX_FILE ".dsc.idx"



typedef struct 
{
	uint32_t u32Mon;      //month;
	uint32_t u32MDay;     //day of month;
 	uint32_t u32SeqNo;    //Sequence number of day
}S_DSC_IDX_ELEM;


class dsc
{
private:
	char *s_pchFilePath;
	uint32_t s_u32FilePathLen;
	S_DSC_IDX_ELEM s_sCurIdxElem;
	
	
public:
	dsc();
ERRCODE DSC_NewCapFile(char *pchDSCFolderPath,int *i32NewFileFD);

void DSC_CloseCapFile(char *pchDSCFolderPath,int i32CloseFileFD);
ERRCODE  GetDSCIndexElem(char *pchDSCFolderPath);	
ERRCODE UpdateDSCIndexFile(	char *pchDSCFolderPath);

};




